package com.lagou;

import com.lagou.service.HomeWork;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class ConsumerApplication {
    public static void main(String[] args) throws  Exception{
        ClassPathXmlApplicationContext applicationContext  = new ClassPathXmlApplicationContext("classpath:dubbo-comsumer.xml");
        HomeWork homeWork  = applicationContext.getBean("homeWork",HomeWork.class);
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                String resultA = homeWork.methodA("methodA");
                String resultB = homeWork.methodB("methodB");
                String resultC = homeWork.methodC("methodC");
            }
        });
        Executors.newSingleThreadScheduledExecutor().scheduleWithFixedDelay(thread, 1,3, TimeUnit.MILLISECONDS);
    }
}
